
@use '../partials/mixin' as mx;

.bookmarks_tab {
  display: flex;
  flex-direction: column;
  gap: 5px;

  ol {
    padding: 0;
    margin: 0;
  }
}

.popover_dialog_reader .settings_tab.bookmarks_tab {
  margin-top: 15px !important;
}

.bookmark_form {
    background-color: var(--color-gray-50);
    border-radius: 6px;
    // border: 1px solid var(--color-gray-300);
    display: flex;
    flex-direction: column;
    // padding: 5px 10px;
    color: var(--color-text-primary);

    // gap: 10px;

    h4 {
      margin: 5px 0;
    }

    label {
      margin: 5px;
    }

    &_textarea{
      width: -webkit-fill-available;
      min-width: -webkit-fill-available;
      max-width: -webkit-fill-available;
      height: 100px;
      min-height: 100px;
      max-height: 300px;
      border: 1px solid rgb(118 118 118);
      border-radius: 3px;
      font-family: Nunito, sans-serif;
      background-color: var(--color-annotation-textarea);
      color: var(--color-text-primary);
      margin: 5px;


      &_container {
      display: flex;
      flex-direction: column;
      }

      &_buttons {
        margin-top: 20px;
        margin-bottom: 5px;
        // margin: 5px 0;
        display: flex;
        gap: 5px;

        button {
          margin-left: 5px;
          min-width: unset;
          width: fit-content;
          height: 25px;
          text-wrap: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;

          &.button_primary_blue {
            color: var(--color-neutral-base);

            &:hover, &:focus:hover {
              color: var(--color-brand-primary)!important;
            }
          }

          svg {
            fill: var(--color-neutral-base);
            color: var(--color-neutral-base);
          }

          &:hover svg {
            fill: var(--color-brand-primary);
            color: var(--color-brand-primary);
          }
        }
      }
    }
  }

.bookmarks_filter {
  &_container {
    background-color: var(--color-gray-50);
    width: 290px;
    // border: 1px solid var(--color-gray-300);
    padding: 15px;
    padding-right: 5px;
    padding-bottom: 0;
    box-shadow: 0 0 5px var(--color-gray-300);
    z-index: 1000;
    border-radius: 5px;
    overflow-y: scroll;

    .annotations_checkbox {
      color: var(--color-text-primary);
    }

    .button_primary_blue:hover {
      // color: var(--color-neutral-base);
      background-color: var(--color-brand-primary);
    }

    @include mx.scrollbar_styling;

    &::-webkit-scrollbar-track {
      background-color: var(--color-gray-50);
    }
  }

  &_nbOfFilters {
    position: absolute;
    color: var(--color-neutral-base);
    width: 10px;
    height: 10px;
    padding: 4px;
    border-radius: 50px;
    background-color: var(--color-brand-primary);
    top: -8px;
    right: -8px;
    margin: 0;
    line-height: 0.9;
  }

  &_button {
    border: 1px solid var(--color-text-primary);
    border-radius: 5px;
    padding: 0 10px;
  }

  &_line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100%);
    gap: 20px;
    padding-right: 10px;
  }

  &_trigger_button {
    width: 30px;
    height: 30px;
    position: relative;
    padding: 5px;

    svg {
      width: 20px;
      height: 20px;
      color: var(--color-brand-primary);
      cursor: pointer;
    }
  }

  &_taglist {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
  }

  &_tagGroup {
    font-family: inherit;
    background-color: var(--color-neutral-base);
    border-radius: 5px;
    padding: 0 20px;
    height: 45px;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 3px 3px var(--color-gray-275);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-text-primary);

    &:hover {
      background-color: var(--color-brand-secondary);
    }
  }

  &_tag {
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 5px;
    border: 1px solid var(--color-brand-primary);
    background-color: var(--color-brand-secondary);
    color: var(--color-brand-primary);

    &[data-selected], &:has(input:checked), &[data-state="checked"] {
      color: var(--color-neutral-base);
      background-color: var(--color-brand-primary);
    }
  }

  &_color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--color-gray-50);

    &[data-selected] {
      outline: 2px solid;
      outline-offset: 2px;
    }
  }

  &_drawtype {
    width: 20px;
    height: 20px;
    padding: 5px;
    border-radius: 5px;

    svg {
      width: 20px;
      height: 20px;
      color: var(--color-text-primary);
    }

    &[data-selected] {
      background-color: var(--color-brand-primary);

      svg {
        color: var(--color-neutral-base);
      }
    }
  }
}

.bookmarks_sorting {
  &_container {
    background-color: var(--color-gray-50);
    width: fit-content;
    // border: 1px solid var(--color-gray-300);
    padding: 15px 5px;
    box-shadow: 0 0 5px var(--color-gray-300);
    z-index: 1000;
    border-radius: 5px;

    @include mx.scrollbar_styling;

    &::-webkit-scrollbar-track {
      background-color: var(--color-gray-50);
    }

    & .my_item {
      font-weight: 600;
      outline: solid 2px transparent !important;
      border-radius: 4px;

      &::before {
        background-color: var(--color-brand-primary) !important;
      }
    }
  }
}

.bookmarksTitle_form {
  &_container {
    width: fit-content;
    height: fit-content;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 15px;
    color: var(--color-text-primary);

    .form_group {
      width: unset;
      border-radius: 6px;
      background-color: var(--color-neutral-base);
    }

    input {
      width: 100%;
      padding: 0;
      height: 22px;
      margin-left: 10px;
      margin-right: 1px;
      border-radius: 6px;
      background-color: var(--color-neutral-base);
    }

    label {
      background: linear-gradient(180deg, var(--color-gray-50) 0%, var(--color-gray-50) 50%, var(--color-neutral-base) 50%, var(--color-neutral-base) 100%);
      top: -5px;
    }

    button {
      width: 100%;
      height: 25px;
    }

    p {
      margin: 0;
    }

    select {
      background-color: var(--color-neutral-base);
      color: var(--color-text-primary);
    }

  }

}

.bookmarks_actions {
&_container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    justify-content: start;

    .react_aria_ComboBox {
      margin: 0;
      padding: 0;
      width: inherit;

      .react_aria_Label {
        width: 100%;
        text-align: left;
      }

      .my_combobox_container {
        background-color: var(--color-neutral-base);
        width: inherit;

        input {
          padding: 0 10px 0 30px !important;
          width: 100%;
        }

        button {
          margin-left: 0;
          padding-left: 0 !important;
        }
      }
    }
  }

  >div {
    display: inherit;

    >div {
      display: flex;
      // gap: 5px;
      align-items: center;
    }

    p {
      margin: 0;
    }

    svg {
      width: 20px;
      height: 20px;
    }
  }


  &_buttons {
    button:disabled {
      border-radius: 5px;
      background-color: var(--color-gray-250);

      svg {
        fill: var(--color-text-primary);
        color: var(--color-text-primary);
      }
    }

    svg {
      fill: var(--color-brand-primary-inverse);
      color: var(--color-brand-primary-inverse);
    }
  }
}

.colorPicker {
  display: flex;
  background-color: var(--color-button-hover);
  padding: 2px;
  gap: 1px;
  border: 1px solid var(--color-gray-900);
  border-radius: 6px;
  width: fit-content;

  &:has(input:focus) {
    @include mx.R2_MIXIN_FOCUS_OUTLINE;
  }

  div {
    input {
      position: absolute;
      z-index: -1;
    }

    label {
      z-index: 20;
      width: 25px;
      height: 25px;
      margin: 0;
      border: 1px solid var(--color-neutral-base);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 5px;
      cursor: pointer;
    }
  }

  svg {
    color: #4d4d4d;
  }
}